#define _GNU_SOURCE
#include "App_Pool.h"
#include "log/log.h"
#include <unistd.h>
#include <stdlib.h>

static int pool_fun(void *arg)
{
    char *msg = (char *)arg;
    log_debug("pool_fun (%d)执行,接受到的消息是%s", gettid(), msg);
    return 0;
}

int main(int argc, char const *argv[])
{
    App_Pool_Init(5);

    for (int i = 0; i < 10; i++)
    {
        char *data = malloc(10);
        sprintf(data, "zy_%d", i);
        App_Pool_RegisterTask(pool_fun, data);
    }

    sleep(1);
    App_Pool_Close();
    return 0;
}
